package com.mutual.attachment.service.impl;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mutual.attachment.dao.AttachmentDao;
import com.mutual.attachment.pojo.Attachment;
import com.mutual.attachment.service.AttachmentService;

@Service
public class AttachmentServiceImpl implements AttachmentService {

	@Resource
	private AttachmentDao attachmentDao;
	
	@Override
	public void insert(Attachment entity) {
		attachmentDao.insertSelective(entity);
	}

	@Override
	public void updateByPrimaryKey(Attachment entity) {
		attachmentDao.updateByPrimaryKeySelective(entity);
	}

	@Override
	public Attachment selectByPrimaryKey(Serializable entityid) {
		return attachmentDao.selectByPrimaryKey(entityid);
	}

	@Override
	public List<Attachment> selectAttachmentByMoudleId(Attachment attachment) {
		return attachmentDao.selectObjectList(attachment);
	}

	@Override
	public int deleteAttachment(int id) {
		attachmentDao.deleteByPrimaryKey(id);
		return 0;
	}

	@Override
	public void deleteAttachmentByMoudleId(Attachment attachment) {
		attachmentDao.deleteAttachmentByMoudleId(attachment);
	}
}
